package com.example.project3

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import androidx.core.app.ComponentActivity


@SuppressLint("RestrictedApi")
class ThirdActivity : ComponentActivity() {
    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_third)

        val confirm = findViewById<Button>(R.id.button)
        val editText = findViewById<EditText>(R.id.editText)
        confirm.setOnClickListener {
            val intent = Intent()
            intent.putExtra(SECOND_MSG,editText.text.toString())
            setResult(1,intent)
            finish()
        }
    }
}